$(document).ready(function(){
	$("#project_create_btn").click(function(){
		var category = $("#category").val();
		var title = $("#title").val();
		var personNum = $("#personNum").val();
		var addtime = $("#addtime").val();
		
		var category_flag = check_category(category);
		var title_flag = check_title(title);
		var personNum_flag = check_num(personNum);
		var addtime_flag = check_num(addtime);
		if(category_flag && title_flag && personNum && addtime_flag){
			$("#create_pro_form").submit();
		}
	});
	function check_category(category){
		if(category.length==0){
			alert("请选择栏目分类!!");
			return false;
		}else{
			return true;
		}
	}
	function check_title(title){
		if(title.length>40){
			alert("项目标题不能超过40个汉字!!");
			return false;
		}else{
			return true;
		}
	}
	function check_num(num){
		var type=/^[0-9]*[1-9][0-9]*$/;
		var re = type.test(num);
		if(re){
			return re;
		}else{
			alert("请输入阿拉伯数字!!");
			return re;
		}
	}
});